package com.changgou.goods.service.impl;

import com.changgou.goods.dao.Temp_spec_paraMapper;
import com.changgou.goods.pojo.Para;
import com.changgou.goods.pojo.Spec;
import com.changgou.goods.pojo.Template;
import com.changgou.goods.service.Temp_spec_paraService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Temp_spec_paraServiceImpl implements Temp_spec_paraService {

    @Autowired
    private Temp_spec_paraMapper temp_spec_paraMapper;

    /**
     * 分页查询模板列表
     *
     * @param pageNum
     * @param pageSize
     */
    @Override
    public PageInfo<Template> findPage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Template> templateList = temp_spec_paraMapper.selectAll();
        return new PageInfo<>(templateList);
    }

    //规格
    @Override
    public List<Spec> findSpec() {
        return temp_spec_paraMapper.findSpec();
    }

    //参数
    @Override
    public List<Para> findPara() {
        return temp_spec_paraMapper.findPara();
    }
}
